package java_class_work.week04;

/**
 * 手动抛出异常
 */
public class ExceptionDemo03 {
    public static void main(String[] args) {
        int res = devide(1,0);
        System.out.println(res);
    }

    private static int devide(int x, int y) {
        if (y==0) {
            throw new ArithmeticException("被除数不能为0！");
        }
        return x/y;
    }
}
